cmake_minimum_required(VERSION 3.15)
project(TaskMaster)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(OpenSSL REQUIRED)
set(Qt6_DIR "/home/code/Qt/6.9.1/gcc_64/lib/cmake/Qt6")
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Multimedia)
set(CMAKE_AUTOMOC ON)

# 添加源文件
file(GLOB_RECURSE SOURCES 
    src/*.cpp
)

# 添加头文件目录
include_directories(
    ${PROJECT_SOURCE_DIR}/src
    ${PROJECT_SOURCE_DIR}/src/core
)

# 添加资源文件
set(RESOURCE_FILE ${PROJECT_SOURCE_DIR}/resources.qrc)
qt_add_resources(RESOURCE_SOURCES ${RESOURCE_FILE})

# 主可执行文件（包含资源）
add_executable(taskmaster ${SOURCES} ${RESOURCE_SOURCES})

# 链接OpenSSL和Qt6
target_link_libraries(taskmaster PRIVATE 
    OpenSSL::SSL 
    OpenSSL::Crypto
    Qt6::Core 
    Qt6::Gui 
    Qt6::Widgets 
    Qt6::Multimedia
)

# 安装目标
install(TARGETS taskmaster DESTINATION bin)